//
//  MenuDetailBottomView.m
//  BaseProject
//
//  Created by 王洋 on 2020/7/27.
//  Copyright © 2020 王洋. All rights reserved.
//

#import "MenuDetailBottomView.h"

@implementation MenuDetailBottomView

- (void)awakeFromNib {
    [super awakeFromNib];
    
    WEAKSELF
    [self.storeControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (weakSelf.MenuDetailBottomViewBlock) {
            weakSelf.MenuDetailBottomViewBlock(MenuDetailBottomActionType_store);
        }
    }];
    
    [self.imControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (weakSelf.MenuDetailBottomViewBlock) {
            weakSelf.MenuDetailBottomViewBlock(MenuDetailBottomActionType_im);
        }
    }];
    
    [self.phoneControl addGestureTapEventHandle:^(id  _Nonnull sender, UITapGestureRecognizer * _Nonnull gestureRecognizer) {
        if (weakSelf.MenuDetailBottomViewBlock) {
            weakSelf.MenuDetailBottomViewBlock(MenuDetailBottomActionType_phone);
        }
    }];
}

- (IBAction)subscribeAction:(id)sender {
    if (self.MenuDetailBottomViewBlock) {
        self.MenuDetailBottomViewBlock(MenuDetailBottomActionType_subscribe);
    }
}


- (void)layoutSubviews {
    [super layoutSubviews];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.yuyueBtn pp_clipCorners:UIRectCornerAllCorners radius:self.yuyueBtn.frame.size.height/2];
    });
    self.phoneControl.hidden = YES;
}

@end
